package com.zxh.dubbozxh.provider;

import com.zxh.dubbozxh.framework.Protocol;
import com.zxh.dubbozxh.framework.ProtocolFactory;
import com.zxh.dubbozxh.framework.URL;
import com.zxh.dubbozxh.framework.register.LocalRegister;
import com.zxh.dubbozxh.framework.register.RemoteMapRegister;
import com.zxh.dubbozxh.provider.api.HelloService;
import com.zxh.dubbozxh.provider.impl.HelloServiceImpl;

public class Provider {

    public static void main(String[] args) {

        LocalRegister.register(HelloService.class.getName(),HelloServiceImpl.class);

        URL url = new URL("localhost", 8080);
        RemoteMapRegister.register(HelloService.class.getName(),url);

        // 接受请求 HTTP请求 TCP请求
        Protocol protocol = ProtocolFactory.getProtocol();
        protocol.start(url);

    }

}
